{
  "nbformat": 4,
  "nbformat_minor": 0,
  "metadata": {
    "colab": {
      "name": "sparse_to_dense_pytorch.ipynb",
      "provenance": [],
      "collapsed_sections": []
    },
    "kernelspec": {
      "name": "python3",
      "display_name": "Python 3"
    },
    "accelerator": "GPU"
  },
  "cells": [
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "XWuXOubGwUY_",
        "outputId": "770807d8-be86-460b-ffb9-cb7b2d436088"
      },
      "source": [
        "cd drive/MyDrive/sparse-to-dense-py/sparse-to-dense.pytorch/"
      ],
      "execution_count": 1,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "/content/drive/MyDrive/sparse-to-dense-py/sparse-to-dense.pytorch\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "y9AFKKjG8G_h",
        "outputId": "a9e16994-b749-4530-d180-3b6baee5537e"
      },
      "source": [
        "!pip uninstall scipy"
      ],
      "execution_count": 2,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "Uninstalling scipy-1.2.2:\n",
            "  Would remove:\n",
            "    /usr/local/lib/python3.6/dist-packages/scipy-1.2.2.dist-info/*\n",
            "    /usr/local/lib/python3.6/dist-packages/scipy/*\n",
            "Proceed (y/n)? y\n",
            "  Successfully uninstalled scipy-1.2.2\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "mEoLkzQ38Po4",
        "outputId": "a117207f-4648-4321-988c-063c3e162a41"
      },
      "source": [
        "!pip install scipy==1.2.2"
      ],
      "execution_count": 3,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "Collecting scipy==1.2.2\n",
            "  Using cached https://files.pythonhosted.org/packages/83/69/20c8f3b7efe362093dff891239551ff90d4c463b5f52676e2694fea09442/scipy-1.2.2-cp36-cp36m-manylinux1_x86_64.whl\n",
            "Requirement already satisfied: numpy>=1.8.2 in /usr/local/lib/python3.6/dist-packages (from scipy==1.2.2) (1.18.5)\n",
            "\u001b[31mERROR: umap-learn 0.4.6 has requirement scipy>=1.3.1, but you'll have scipy 1.2.2 which is incompatible.\u001b[0m\n",
            "\u001b[31mERROR: tensorflow 2.3.0 has requirement scipy==1.4.1, but you'll have scipy 1.2.2 which is incompatible.\u001b[0m\n",
            "\u001b[31mERROR: albumentations 0.1.12 has requirement imgaug<0.2.7,>=0.2.5, but you'll have imgaug 0.2.9 which is incompatible.\u001b[0m\n",
            "Installing collected packages: scipy\n",
            "Successfully installed scipy-1.2.2\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "Dp9gQ9FR8wt-",
        "outputId": "ade9b9f8-cca8-476d-8f48-4b4d07b066bd"
      },
      "source": [
        "!python3 main.py --evaluate results/2/model_best.pth.tar --modality rgbd"
      ],
      "execution_count": 4,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "Namespace(arch='resnet18', batch_size=8, criterion='l1', data='nyudepthv2', decoder='deconv2', epochs=15, evaluate='results/2/model_best.pth.tar', lr=0.01, max_depth=-1.0, modality='rgbd', momentum=0.9, num_samples=0, pretrained=True, print_freq=10, resume='', sparsifier='uar', weight_decay=0.0001, workers=10)\n",
            "=> loading best model 'results/2/model_best.pth.tar'\n",
            "/usr/local/lib/python3.6/dist-packages/torch/serialization.py:658: SourceChangeWarning: source code of class 'torch.nn.modules.conv.Conv2d' has changed. you can retrieve the original source code by accessing the object's source attribute or set `torch.nn.Module.dump_patches = True` and use the patch tool to revert the changes.\n",
            "  warnings.warn(msg, SourceChangeWarning)\n",
            "/usr/local/lib/python3.6/dist-packages/torch/serialization.py:658: SourceChangeWarning: source code of class 'torch.nn.modules.batchnorm.BatchNorm2d' has changed. you can retrieve the original source code by accessing the object's source attribute or set `torch.nn.Module.dump_patches = True` and use the patch tool to revert the changes.\n",
            "  warnings.warn(msg, SourceChangeWarning)\n",
            "/usr/local/lib/python3.6/dist-packages/torch/serialization.py:658: SourceChangeWarning: source code of class 'torch.nn.modules.activation.ReLU' has changed. you can retrieve the original source code by accessing the object's source attribute or set `torch.nn.Module.dump_patches = True` and use the patch tool to revert the changes.\n",
            "  warnings.warn(msg, SourceChangeWarning)\n",
            "/usr/local/lib/python3.6/dist-packages/torch/serialization.py:658: SourceChangeWarning: source code of class 'torch.nn.modules.pooling.MaxPool2d' has changed. you can retrieve the original source code by accessing the object's source attribute or set `torch.nn.Module.dump_patches = True` and use the patch tool to revert the changes.\n",
            "  warnings.warn(msg, SourceChangeWarning)\n",
            "/usr/local/lib/python3.6/dist-packages/torch/serialization.py:658: SourceChangeWarning: source code of class 'torch.nn.modules.container.Sequential' has changed. you can retrieve the original source code by accessing the object's source attribute or set `torch.nn.Module.dump_patches = True` and use the patch tool to revert the changes.\n",
            "  warnings.warn(msg, SourceChangeWarning)\n",
            "/usr/local/lib/python3.6/dist-packages/torch/serialization.py:658: SourceChangeWarning: source code of class 'torchvision.models.resnet.Bottleneck' has changed. you can retrieve the original source code by accessing the object's source attribute or set `torch.nn.Module.dump_patches = True` and use the patch tool to revert the changes.\n",
            "  warnings.warn(msg, SourceChangeWarning)\n",
            "/usr/local/lib/python3.6/dist-packages/torch/serialization.py:658: SourceChangeWarning: source code of class 'torch.nn.modules.upsampling.Upsample' has changed. you can retrieve the original source code by accessing the object's source attribute or set `torch.nn.Module.dump_patches = True` and use the patch tool to revert the changes.\n",
            "  warnings.warn(msg, SourceChangeWarning)\n",
            "=> loaded best model (epoch 7)\n",
            "=> creating data loaders ...\n",
            "Found 47584 images in train folder.\n",
            "Found 93 images in val folder.\n",
            "=> data loaders created.\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "Test: [10/93]\tt_GPU=0.082(0.648)\n",
            "\tRMSE=3.53(3.07) MAE=2.62(2.46) Delta1=0.066(0.112) REL=0.832(0.736) Lg10=0.296(0.260) \n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "Test: [20/93]\tt_GPU=0.075(0.363)\n",
            "\tRMSE=4.35(3.19) MAE=3.08(2.51) Delta1=0.136(0.147) REL=1.028(0.808) Lg10=0.313(0.262) \n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "Test: [30/93]\tt_GPU=0.077(0.267)\n",
            "\tRMSE=3.64(3.37) MAE=2.45(2.53) Delta1=0.206(0.148) REL=1.262(0.913) Lg10=0.312(0.281) \n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "Test: [40/93]\tt_GPU=0.075(0.220)\n",
            "\tRMSE=4.50(3.60) MAE=3.25(2.65) Delta1=0.107(0.147) REL=1.259(1.054) Lg10=0.391(0.300) \n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "Test: [50/93]\tt_GPU=0.090(0.191)\n",
            "\tRMSE=2.91(3.60) MAE=2.35(2.66) Delta1=0.214(0.149) REL=0.647(1.014) Lg10=0.274(0.303) \n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "Test: [60/93]\tt_GPU=0.081(0.173)\n",
            "\tRMSE=3.45(3.54) MAE=2.84(2.65) Delta1=0.105(0.149) REL=0.857(0.984) Lg10=0.358(0.307) \n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "Test: [70/93]\tt_GPU=0.084(0.159)\n",
            "\tRMSE=3.00(3.48) MAE=2.12(2.62) Delta1=0.213(0.146) REL=0.590(0.938) Lg10=0.301(nan) \n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "rgb (480, 640, 3)\n",
            "depth (480, 640)\n",
            "Test: [80/93]\tt_GPU=0.073(0.148)\n",
            "\tRMSE=2.64(3.39) MAE=1.98(2.54) Delta1=0.236(0.157) REL=0.634(0.896) Lg10=0.272(nan) \n",
            "Test: [90/93]\tt_GPU=0.076(0.140)\n",
            "\tRMSE=3.57(3.37) MAE=3.00(2.54) Delta1=0.109(0.157) REL=1.153(0.899) Lg10=0.316(nan) \n",
            "\n",
            "*\n",
            "RMSE=3.354\n",
            "MAE=2.532\n",
            "Delta1=0.157\n",
            "REL=0.892\n",
            "Lg10=nan\n",
            "t_GPU=0.138\n",
            "\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "x6AmkUr6wi2y",
        "outputId": "a2955c75-15b0-43d8-b620-c4c3b7049ff4"
      },
      "source": [
        "ls data/nyudepthv2/"
      ],
      "execution_count": 5,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "\u001b[0m\u001b[01;34mtrain\u001b[0m/  \u001b[01;34mval\u001b[0m/  \u001b[01;34mval1\u001b[0m/  \u001b[01;34mval2\u001b[0m/  \u001b[01;34mval3\u001b[0m/  val.tar.xz\n"
          ],
          "name": "stdout"
        }
      ]
    }
  ]
}